-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: New algod endpoint /v2/header/{round}/header
omits transactions and cert from response
#6163
base: master
Are you sure you want to change the base?
Conversation
Retrieve only the block header (sans transactions)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6163 +/- ##
==========================================
+ Coverage 55.99% 56.24% +0.24%
==========================================
Files 494 494
Lines 69958 69978 +20
==========================================
+ Hits 39174 39360 +186
+ Misses 28077 27939 -138
+ Partials 2707 2679 -28 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the test, otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it is better to round trip a header from a mock in the test but LGTM
} | ||
|
||
// Encoding wasn't working well without embedding "real" objects. | ||
response := struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a defined type somewhere, or do we think single use-case/good enough?
Retrieve just the block header information without the transactions and cert data. This reduces the response size and response time, but still includes block details such as the proposer and any incentive rewards.
With the introduction of consensus incentives, various people have asked how they can obtain this new data per block without also including all the transaction data in the response. This was considered a useful option, so thought I'd have a go at implementing it. Support for both json and msgpack is available, and a very simple test was included.